package com.weiyirong99.crm.app.ui;

import android.content.Context;
import android.widget.CheckBox;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.AttachPopupView;
import com.lxj.xpopup.core.BottomPopupView;
import com.weiyirong99.crm.app.R;
import com.weiyirong99.crm.app.util.MyClick;

public class PatternPopup extends BottomPopupView {

    private Context context;
    private CheckBox cbGlobal, cbSmart;
    private String type;
    private LinearLayout llSmart;
    private LinearLayout llGlobal;
    private LinearLayout llPhone;

    private void initView() {
        llSmart = (LinearLayout) findViewById(R.id.ll_smart);
        llGlobal = (LinearLayout) findViewById(R.id.ll_global);
        llPhone = (LinearLayout) findViewById(R.id.ll_phone);
    }

    public interface PatternClickListener {
        void onClick(String type);
    }

    private PatternClickListener patternClickListener;

    public PatternPopup(@NonNull Context context, PatternClickListener patternClickListener) {
        super(context);
        this.context = context;
        this.patternClickListener = patternClickListener;

    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.pattern_popup;
    }

    @Override
    protected void onCreate() {
        super.onCreate();

        findViewById(R.id.ll_smart).setOnClickListener(new MyClick(V -> {
            patternClickListener.onClick("客户详情");
            dismiss();
        }));
        findViewById(R.id.ll_global).setOnClickListener(new MyClick(V -> {
            patternClickListener.onClick("工单详情");
            dismiss();
        }));
        findViewById(R.id.ll_global).setOnClickListener(new MyClick(V -> {
            patternClickListener.onClick("拨打电话");
            dismiss();
        }));
    }


    private void selectCheck(CheckBox checkBox) {

    }


}
